import { Injectable } from '@nestjs/common'
import { InjectRepository } from '@nestjs/typeorm'
import { TreeRepository } from 'typeorm'
import { Menu } from '@/entities/menu.entity'
@Injectable()
export class PermissionService {
  constructor(
    @InjectRepository(Menu)
    private readonly menuRepository: TreeRepository<Menu>
  ) {}
  findAll() {
    return this.menuRepository.findTrees({
      relations: ['permissions'],
    })
  }
}
